﻿<UserControl x:Class="Locima.SlidingBlock.Controls.Acknowledgements"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
             FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}"
             Foreground="{StaticResource PhoneForegroundBrush}" d:DesignHeight="768" d:DesignWidth="480"
             xmlns:Controls="clr-namespace:Locima.SlidingBlock.Controls">
    
    <!-- I had to set the background explicitly here just so it would show up in the design view.  For some reason
    Grid shows up by default with a black background, but StackPanel doesn't.  Weird huh? -->
    <StackPanel x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
        <StackPanel.Resources>
            <Controls:AcknowledgementList x:Name="AckList">
                <Controls:Acknowledgement Title="Windows Phone Mango Jump Start"
                                          Author="Rob Miles &amp; Andy Wigley"
                                          Link="http://channel9.msdn.com/Series/Mango-Jump-Start/"
                                          Description="These (funny) guys hosted the Windows Phone Mango Jump Start videos, which provided me with a great start to understanding development on WP7." />
                <Controls:Acknowledgement Title="Windows Phone Geek" Link="http://www.windowsphonegeek.com/"
                                          Author="Various"
                                          Description="Windows Phone Geek provides countless useful articles on Windows Phone development.  DelegateCommand came from here." />
                <Controls:Acknowledgement Title="NLog for Windows Phone 7"
                                          Author="Jarek Kowalski"
                                          Link="http://nlog-project.org/2011/01/09/nlog-for-windows-phone-7.html"
                                          Description="NLog is an invaluable tool, it's used in this project for creating a debug trace" />
                <Controls:Acknowledgement Title="Little Watson"
                                          Author="Andy Pennell"
                                          Link="http://blogs.msdn.com/b/andypennell/archive/2010/11/01/error-reporting-on-windows-phone-7.aspx"
                                          Description="Little Watson allows bug reports to be sent back to me" />
                <Controls:Acknowledgement Title="Your Last About Dialog"
                                          Author="Peter Kuhn (Mister_Goodcat)"
                                          Link="http://ylad.codeplex.com/" Description="Your Last About Dialog was used for this very page!" />
                <Controls:Acknowledgement Title="Windows Phone Silverlight Toolkit"
                                          Author="Microsoft"
                                          Link="http://silverlight.codeplex.com/"
                                          Description="Lots of great utility classes that eased the development of this app" />
                <Controls:Acknowledgement Title="WriteableBitmapEx"
                                          Link="http://writeablebitmapex.codeplex.com/"
                                          Author="Various"
                                          Description="A very handy set of extension methods for the WriteableBitmap class"/>
                <Controls:Acknowledgement Title="MetroGridHelper"
                                          Link="http://www.jeff.wilcox.name/2011/10/metrogridhelper/"
                                          Author="Jeff Wilcox"
                                          Description="Helped me to work out how to lay out my controls (although I've probably done it badly!)"/>
                <Controls:Acknowledgement Title="Sandcastle"
                                          Link="http://shfb.codeplex.com/"
                                          Author="Eric Woodruff"
                                          Description="Sandcastle builds the HTML API documentation."/>
                <Controls:Acknowledgement Title="From Concept to Code in 6 hours: Shipping my first Windows Phone App"
                                          Author="Scott Hanselman"
                                          Description="I was inspired to write this having read Scott's post on &quot;Shipping my first Windows App&quot;.  He's a truly motivational speaker and writer!"
                                          Link="http://www.hanselman.com/blog/FromConceptToCodeIn6HoursShippingMyFirstWindowsPhoneApp.aspx"/>
                <Controls:Acknowledgement Title="WP7 Binding - Lost Focus Workaround"
                                          Author="Frederick Chapleau"
                                          Description="A pattern for updating bindings when application bar buttons are clicked"
                                          Link="http://www.chapleau.info/blog/2012/01/15/WP7BindingLostFocusWorkaround.html"/>
                <Controls:Acknowledgement Title="The 15 Puzzle"
                                          Author="Jim Loy"
                                          Description="Jim's algorithm for using parity to check whether a puzzle is solveable saved me from an embarrasing bug!"
                                          Link="http://www.jimloy.com/puzz/15.htm"/>
            </Controls:AcknowledgementList>
            <Style TargetType="HyperlinkButton" x:Name="hyperlink">
                <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
            </Style>
        </StackPanel.Resources>

        <TextBlock 
                   Text="{Binding Path=Strings.AcknowledgementsLeader, Source={StaticResource Localization}}"
                   Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" />

        <ListBox ItemsSource="{StaticResource AckList}" x:Name="AckListBox" ScrollViewer.VerticalScrollBarVisibility="Disabled"> 
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Margin="0,12,0,0">
                        <TextBlock 
                            Style="{StaticResource PhoneTextTitle3Style}"
                                   Foreground="{StaticResource PhoneAccentBrush}" Text="{Binding Title}" />
                        <TextBlock Style="{StaticResource PhoneTextNormalStyle}"
                                   Foreground="{StaticResource PhoneAccentBrush}" Text="{Binding Author}" />
                        <TextBlock TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"
                                   Text="{Binding Description}" />
                        <HyperlinkButton TargetName="_blank" NavigateUri="{Binding Link}" Content="{Binding Link}"
                                         Style="{StaticResource hyperlink}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </StackPanel>
</UserControl>